<template>
  <panel title="添加商品">
    <GoodsForm @success="success"></GoodsForm>
  </panel>
</template>

<script>
import Panel from '@/panel/Panel.vue'
import GoodsForm from './components/GoodsForm.vue'
import { goodsAddReq } from '@/api/goods.api'
export default {
  components: {
    GoodsForm,
    Panel
  },
  data() {
    return {
    }
  },
  methods: {
    success(goodsAdd) {
      console.log(goodsAdd);
      goodsAddReq(goodsAdd).then(res => {
        console.log(res);
        this.$message.success('商品添加成功！')
        this.$router.push('/goods/list')
      })
    }
  }
}
</script>

<style lang="less" scoped>

</style>